<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<body>

	<h:form>
		<p:commandLink ajax="false"
			action="/view.xhtml?javax.portlet.faces.PortletMode=view&amp;javax.portlet.faces.WindowState=normal">
			<p:graphicImage value="/images/Home-Button.png" />
		</p:commandLink>
		<p:graphicImage value="/images/flags/#{myBean.selectedCountry}.png"
			style="text-align:center;width:30px;height:30px;" />
	</h:form>

	<h:form id="prescriptionForm">
		<p:panel header="#{translationBean.report_summary}">
			<table>
				<tr>
					<td><b><h:outputText
								value="#{translationBean.patient_data_givenname}" /></b></td>
					<td>&nbsp;</td>
					<td><h:outputText value="#{myBean.selectedPatient.name}" /></td>
				</tr>
				<tr>
					<td><b><h:outputText
								value="#{translationBean.patient_data_surname}" /></b></td>
					<td>&nbsp;</td>
					<td><h:outputText value="#{myBean.selectedPatient.familyName}" /></td>
				</tr>
				<tr>
					<td><b><h:outputText
								value="#{translationBean.patient_data_street_address}" /></b></td>
					<td>&nbsp;</td>
					<td><h:outputText value="#{myBean.selectedPatient.address}" /></td>
				</tr>
				<tr>
					<td><b><h:outputText
								value="#{translationBean.patient_data_code}" /></b></td>
					<td>&nbsp;</td>
					<td><h:outputText value="#{myBean.selectedPatient.postalCode}" /></td>
				</tr>
				<tr>
					<td><b><h:outputText
								value="#{translationBean.patient_data_city}" /></b></td>
					<td>&nbsp;</td>
					<td><h:outputText value="#{myBean.selectedPatient.city}" /></td>
				</tr>
				<tr>
					<td><b><h:outputText
								value="#{translationBean.patient_data_country}" /></b></td>
					<td>&nbsp;</td>
					<td><h:outputText value="#{myBean.selectedPatient.country}" /></td>
				</tr>
			</table>
		</p:panel>
		<p:dataTable var="document" value="#{myBean.patientPrescriptions}" emptyMessage="#{myBean.queryPrescriptionsException}">
<!-- 
			<p:column>
				<f:facet name="header">
					<h:outputText value="#{translationBean.patient_data_title}" />
				</f:facet>
				<h:outputText value="#{document.formatCode.value}" />
			</p:column>
 -->			
			<p:column>
				<f:facet name="header">
					<h:outputText
						value="#{translationBean.report_document_description}" />
				</f:facet>
				<h:outputText value="#{document.description}" />
			</p:column>
			<p:column>
				<f:facet name="header">
					<h:outputText
						value="#{translationBean.report_document_author_person}" />
				</f:facet>
				<h:outputText value="#{document.author}" />
			</p:column>
			<p:column>
				<f:facet name="header">
					<h:outputText
						value="#{translationBean.report_document_creation_time}" />
				</f:facet>
				<h:outputText value="#{document.creationDate}" />
			</p:column>
<!-- 
			<p:column>
				<f:facet name="header">
					<h:outputText
						value="#{translationBean.report_document_healthcare_facility_type_code}" />
				</f:facet>
				<h:outputText value="#{document.healthcareFacility}" />
			</p:column>
 -->			
			<p:column>
				<f:facet name="header">
					<h:outputText value="" />
				</f:facet>				
					
				<!-- 
				<p:commandButton ajax="false" icon="ui-icon-search"
					title="#{translationBean.report_document_header_title}"
					action="/viewPrescriptionInfo.xhtml?javax.portlet.faces.PortletMode=view&amp;javax.portlet.faces.WindowState=normal">
					<f:setPropertyActionListener value="#{document}"
						target="#{myBean.selectedDocument}" />
				</p:commandButton>
				 -->
<!-- 
				<h:button outcome="viewCDAHtml" value="CDA" icon="ui-icon-search">
					<f:param name="uuid" value="#{document.uuid}" />
					<f:param name="repositoryid" value="#{document.repositoryId}" />
					<f:param name="hcid" value="#{document.hcid}" />
					<f:param name="docType" value="ep" />		
				</h:button>
				
				<h:button outcome="viewPDF" value="PDF" icon="ui-icon-search">
					<f:param name="uuid" value="#{document.uuid}" />
					<f:param name="repositoryid" value="#{document.repositoryId}" />
					<f:param name="hcid" value="#{document.hcid}" />
					<f:param name="docType" value="ep" />	
				</h:button>
 -->
 				<h:outputLink value="/epsosportal/cdaServlet?uuid=#{document.uuid}&amp;repositoryid=#{document.repositoryId}&amp;hcid=#{document.hcid}&amp;docType=ep"
 						target="_blank" rendered="#{document.formatCode.value=='urn:epSOS:ep:pre:2010'}">
 						<p:graphicImage value="/images/document.png" style="text-align:center;width:30px;height:30px;" />
    			</h:outputLink>  
    			
 				<h:outputLink value="/epsosportal/pdfServlet?uuid=#{document.uuid}&amp;repositoryid=#{document.repositoryId}&amp;hcid=#{document.hcid}&amp;docType=ep"
 					target="_blank" rendered="#{document.formatCode.value=='urn:ihe:iti:xds-sd:pdf:2008'}">
 					<p:graphicImage value="/images/pdf_icon.png" style="text-align:center;width:30px;height:30px;" />  
    			</h:outputLink>  
				
				<!-- 				 
				<p:commandButton id="downloadLink" value="Download" ajax="true"
					onclick="PrimeFaces.monitorDownload(start, stop)"
					icon="ui-icon-arrowthichk-s">
					<f:setPropertyActionListener value="#{document}"
						target="#{myBean.selectedPrescriptionFile}" />
					<p:fileDownload value="#{myBean.prescriptionFile}" />
				</p:commandButton>
 -->				
			</p:column>
		</p:dataTable>		 
	</h:form>
</body>
</html>